package cn.tedu.validation;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

public class User {
    @NotNull(message = "你的用户名呢?????")
    //pattern  模式
    @Pattern(regexp = "[a-zA-Z0-9_-]{4,16}",
    message = "登录失败,用户格式错误!")
    private String username;
    @NotNull(message = "登陆失败,必须提交密码!!!")
    private String password;

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
